﻿
namespace BEGDC.PreContract.DAL
{
    using System;
    using System.Collections.Generic;
    using Castle.ActiveRecord;
    using NHibernate.Expression;


    [ActiveRecord]
    public partial class CAT : ActiveRecordBase<CAT>
    {
		#region Const Definition
		
		public const string CONST_CATID									= "CATID";
		public const string CONST_CATCode								= "CATCode";
		public const string CONST_CATCode_Shortening					= "CATCode_Shortening";
		public const string CONST_CATName								= "CATName";
		public const string CONST_SortNumber							= "SortNumber";
		public const string CONST_Active								= "Active";
		public const string CONST_CreateDate							= "CreateDate";
		public const string CONST_UpdateDate							= "UpdateDate";

		#endregion
		
        #region Member Variables
        // Primary Key
        private System.Int32 _cATID;
        
        // Non Key
        private System.String _cATCode;
        private System.String _cATCode_Shortening;
        private System.String _cATName;
        private System.Int32 _sortNumber;
        private System.Boolean _active;
        private Nullables.NullableDateTime _createDate;
        private Nullables.NullableDateTime _updateDate;

        // Parents
        
        
		

        #endregion

        public CAT() {
               
        }
        public CAT(
            System.String cATCode
            ,System.String cATCode_Shortening
            ,System.String cATName
            ,System.Int32 sortNumber
            ,System.Boolean active
            ,Nullables.NullableDateTime createDate
            ,Nullables.NullableDateTime updateDate) : this() {
                
            this._cATCode = cATCode; 
            this._cATCode_Shortening = cATCode_Shortening; 
            this._cATName = cATName; 
            this._sortNumber = sortNumber; 
            this._active = active; 
            this._createDate = createDate; 
            this._updateDate = updateDate; 
        }
        
        #region Properties
        // Primary Key        
		
		#if (SQLServer)
        [PrimaryKey]
		#else
		[PrimaryKey(PrimaryKeyType.Native, SequenceName = "SEQ_CAT_CATID")]
		#endif
        public System.Int32 CATID {
            get { return this._cATID; }
            set {  this._cATID = value; }
        }
        
        // Non Key
        [Property]
        public System.String CATCode {
            get { return this._cATCode; }
			set { if (value == null) return; if (value.Length > 10) this._cATCode = value.Substring(0,10); else this._cATCode = value; }	
        }
        
        [Property]
        public System.String CATCode_Shortening {
            get { return this._cATCode_Shortening; }
			set { if (value == null) return; if (value.Length > 10) this._cATCode_Shortening = value.Substring(0,10); else this._cATCode_Shortening = value; }	
        }
        
        [Property]
        public System.String CATName {
            get { return this._cATName; }
			set { if (value == null) return; if (value.Length > 50) this._cATName = value.Substring(0,50); else this._cATName = value; }	
        }
        
        [Property]
        public System.Int32 SortNumber {
            get { return this._sortNumber; }
			set { this._sortNumber = value; }
        }
        
        [Property]
        public System.Boolean Active {
            get { return this._active; }
			set { this._active = value; }
        }
        
        [Property]
        public Nullables.NullableDateTime CreateDate {
            get { return this._createDate; }
			set { this._createDate = value; }
        }
        
        [Property]
        public Nullables.NullableDateTime UpdateDate {
            get { return this._updateDate; }
			set { this._updateDate = value; }
        }
        
        
        // Parent Relationships
        // Child Relationships
        
		
        #endregion
		
		// Clone
		public CAT Clone()
		{
			CAT newCAT = new CAT();
			
            newCAT.CATCode = this._cATCode; 
            newCAT.CATCode_Shortening = this._cATCode_Shortening; 
            newCAT.CATName = this._cATName; 
            newCAT.SortNumber = this._sortNumber; 
            newCAT.Active = this._active; 
            newCAT.CreateDate = this._createDate; 
            newCAT.UpdateDate = this._updateDate; 
			return newCAT;
		}
    }
}



